package com.tang.algorithm.ordinary;

/**
 * @author tlm
 * @version 1.0
 * @date 2020/6/2 23:45
 */
public class LeetCode1342 {
    public static void main(String[] args) {
        System.out.println(numberOfSteps(14));
    }
    public static int numberOfSteps (int num) {
        int count = 0;
        while (num!=0){
            if(num%2==0) num/=2;
            else if(num%2==1) num-=1;
            count++;
        }
        return count;
    }
}
